<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    body {
      height: 100vh;
      background-color: rgb(180, 8, 180);
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .container {
      display: flex;
      gap: 10px;
      width: 90vw;
      height: 80vh;
    }

    .container .panel {
      position: relative;
      flex: 1;
      border-radius: 20px;
      overflow: hidden;
      transition: all .5s ease-in;
    }

    .container .panel h3 {
      position: absolute;
      bottom: 10px;
      left: 10px;
      color: #fff;
      opacity: 0;
      transition: all .4s ease-in .6s;
    }

    .panel.active {
      flex: 4;
    }

    .panel.active h3 {
      opacity: 1;
    }

    @media (max-width:480px) {
      .container {
        width: 100vw;
      }

      .panel:nth-of-type(4),
      .panel:nth-of-type(5) {
        display: none;
      }
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="panel active" style="background: url(./imgs/1.jpeg) center/cover;">
      <h3>aqlpl</h3>
    </div>
    <div class="panel" style="background: url(./imgs/6.jpeg) center/cover;">
      <h3>hdfhfd</h3>
    </div>
    <div class="panel" style="background: url(./imgs/2.jpg) center/cover;">
      <h3>fdasfas</h3>
    </div>
    <div class="panel" style="background: url(./imgs/3.jpg) center/cover;">
      <h3>rwerwe</h3>
    </div>
    <div class="panel" style="background: url(./imgs/4.jpg) center/cover;">
      <h3>oiuyi</h3>
    </div>
  </div>
</body>
<script>
  let panels = document.querySelectorAll('.panel');
  panels.forEach(item => {
    item.addEventListener('click', () => {
      panels.forEach(itm => {
        itm.classList.remove('active');
      })
      item.classList.add('active');
    });
  })
</script>

</html>